package behavioral_pattern.visitor_pattern;

/**
 * 访问者设计模式
 */

public class MainVisitor {
    public static void main(String[] args) {
        EmployeeList list = new EmployeeList();
        Employee fte1, fte2, fte3, pte1, pte2;

        fte1 = new FulltimeEmployee("张无忌", 3200, 45);
        fte2 = new FulltimeEmployee("阳光", 1000, 40);
        fte3 = new FulltimeEmployee("杨过", 4000, 10);

        pte1 = new ParttimeEmployee("过劲", 80, 20);
        pte2 = new ParttimeEmployee("郭靖", 60, 10);

        list.addEmployee(fte1);
        list.addEmployee(fte2);
        list.addEmployee(fte3);
        list.addEmployee(pte1);
        list.addEmployee(pte2);

        Department department;
        department = new FADepartment();
        list.accept(department);
    }
}
